import { PermissionList } from '@/api/acl/permission-type.ts';
import type { InjectionKey } from 'vue';

// 添加一个展开属性
export interface MyPermissionList extends PermissionList {
  expand: boolean;
}

// showDialog函数类型
type DialogType = 'SAVE' | 'UPDATE';
// type为DELETE时 permission为number类型
export type ShowDialogFn = (
  type: DialogType,
  permission: PermissionList
) => void;

// 用于Inject和provide的key值
export const permissionKey = Symbol('permission') as InjectionKey<ShowDialogFn>;

// refreshData函数
export type RefreshDataFn = (flag?: string) => void;

export const refreshDataFnKey = Symbol(
  'refreshData'
) as InjectionKey<RefreshDataFn>;
